namespace SharpTalk.Core.Services
{
    using Interfaces;
    using System;
    using System.Runtime.Serialization;
    /// <summary>
    /// Abstract request class
    /// </summary>
    /// <typeparam name="TContent">The type of the content</typeparam>
    [DataContract]
    [Serializable]
    public abstract class RequestBase<TContent> 
        : IRequest<TContent>
    {
        private Guid _owner;
        /// <summary>
        /// Creates a new instance
        /// </summary>
        protected RequestBase(){}
        /// <summary>
        /// Creates a new Instance
        /// </summary>
        /// <param name="owner">The owner Guid</param>
        protected RequestBase(Guid owner) : this()
        {
            _owner = owner;
        }
        /// <summary>
        /// Obtains or define the owner
        /// </summary>
        [DataMember(IsRequired = true)]
        public virtual Guid Owner { get { return _owner; } set { _owner = value; } }
        /// <summary>
        /// Obtains or defines the content
        /// </summary>
        [DataMember(IsRequired = true)]
        public virtual TContent Content { get; set; }
    }
}